function getCurrentDate(inputYear) {
	if(inputYear==null || inputYear==""){
		inputYear=0;
	}
	var myDate = new Date();
//	 var currDate = myDate.toLocaleDateString(); //获取当前日期
//	 var mytime=myDate.toLocaleTimeString(); //获取当前时间

	var year = myDate.getFullYear()+parseInt(inputYear+""); ;
	var month = myDate.getMonth()+1;
	var dates = myDate.getDate();
	var currDate = year + "-";
	if(month < 10){
		currDate = currDate + "0" + month + "-";
	}else {
		currDate = currDate + month + "-";
	}
	
	if(dates < 10){
		currDate = currDate + "0" + dates;
	}else {
		currDate = currDate + dates;
	}
	// var monthStr = ("00"+month).substring();

//	var currentDate = year + "-" + month + "-" + dates;
	 return currDate;
}
//数字验证
function isInteger(str) {
	if (/^-?\d+$/.test(str)) {
		return true;
	}
	return false;
}
//日期验证
function isDate(str) {
	var reg = /^((((1[6-9]|[2-9]\d)\d{2})-(0?[13578]|1[02])-(0?[1-9]|[12]\d|3[01]))|(((1[6-9]|[2-9]\d)\d{2})-(0?[13456789]|1[012])-(0?[1-9]|[12]\d|30))|(((1[6-9]|[2-9]\d)\d{2})-0?2-(0?[1-9]|1\d|2[0-8]))|(((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))-0?2-29-))$/;
	if (reg.test(str)) {
		return true;
	}
	return false;
}

//将一个表单的数据返回成JSON对象
$.fn.serializeObject = function() {
  var o = {};
  var a = this.serializeArray();
  $.each(a, function() {
    if (o[this.name]) {
      if (!o[this.name].push) {
        o[this.name] = [ o[this.name] ];
      }
      o[this.name].push(this.value || '');
    } else {
      o[this.name] = this.value || '';
    }
  });
  return o;
};

//动态生成超链接
function autoCreateLink(linkHref, i, appendTargetId) {
   var a=document.createElement("a");
   a.id="a"+i;
   a.href=linkHref;
   a.innerText="详情";
   a.title="详情"+i;
   //alert(a);
   var targetId = document.getElementById(appendTargetId);
   //alert(targetId);
   targetId.appendChild(a);
}


//动态生成超链接button
function autoCreateLinkButton(linkHref, i, appendTargetId) {
   var obj = document.createElement("input");
   obj.setAttribute("id", "button"+i);
   obj.setAttribute("type", "button");
   obj.setAttribute("value", "详情");
   obj.setAttribute("onclick", "autoClick()");
   var targetId = document.getElementById(appendTargetId);
   targetId.appendChild(obj);
}

//校验手机账号
//传入手机号输入框ID 返回：false 错误的手机号; true 正确的手机号 
function checkMobile(id_){
    var sMobile =  document.getElementById(id_).value;
    
    return (/^1[3|4|5|7|8][0-9]\d{4,8}$/.test(sMobile));
   /* if(!(/^1[3|4|5|8][0-9]\d{4,8}$/.test(sMobile))){
        alert("不是完整的11位手机号或者正确的手机号前七位");
        document.getElementById(id_).focus();
        return false;
    }else{
    	return true;
    }*/
} 
//传入email内容
//返回：正确 true , 错误false
function isEmail(strEmail) {
	return (strEmail.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1);
}
//传入的str如果都是空格的话， 返回true， 证明是空字符串
function isTrimString(str){
	return (str.replace(/(^s*)|(s*$)/g, "").length==0);
}

